#!/bin/bash

username=$(whoami)
groupstr=$(getent group $username | grep -E "^$username")
array=(${groupstr//:/ })
group=${array[0]}

echo "$username"
echo "$group"